package cn.bandeqing.workTime.controller;

import cn.bandeqing.base.resp.Resp;
import cn.bandeqing.workTime.req.WorkTimeModifyReq;
import cn.bandeqing.workTime.resp.WorkTimeList;
import cn.bandeqing.workTime.rpc.IWorkTimeRpc;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Tag(name = "工作人员 工作日程")
@RequestMapping("/workTime")
@RestController
public class WorkTimeController {

    @DubboReference
    private IWorkTimeRpc workTimeRpc;

    @Operation(summary = "修改工作日程")
    @PostMapping("/modify")
    public Resp<Void> modify(@RequestBody @Valid WorkTimeModifyReq req) {
        return workTimeRpc.modify(req);
    }

    @Operation(summary = "工作人员（收纳）注册")
    @PostMapping("/list")
    public Resp<List<WorkTimeList>> list() {
        return workTimeRpc.list();
    }

}
